{include file=header.html}
	<div id="wrapper">
		{include file=curlocal.html}
		<div class="content content-wtop">
			<div class="main-adv" style="margin-bottom: 0px;">
				<div id="module_middle">
					<div class="slider-wrapper theme-default">
						<div class="ribbon"></div>
						<div id="slider" class="nivoSlider">
							<a href=""><img src="data/files/mall/template/201108251011061705.png" width="610" height="280"/></a>       
							<a href=""><img src="data/files/mall/template/201108251011063049.png" width="610" height="280"/></a>
							<a href=""><img src="data/files/mall/template/201108251011065593.png" width="610" height="280"/></a>
							<a href=""><img src="data/files/mall/template/201108251011065223.png" width="610" height="280"/></a>
						</div>
					</div>
					<script type="text/javascript" src="includes/libraries/javascript/jquery.slider.js" charset="utf-8"></script>
					<script type="text/javascript">
						$(window).load(function() {
							$('#slider').nivoSlider();
						});
					</script>
				</div>
				<div class="sidebar-adv">
					<div class="module-adv">
						<div class="module-adv-top">
							<a href=""><img src="data/files/mall/template/adv_top.png"/></a>       
						</div>
						<div class="module-adv-bottom">
							<a href=""><img src="data/files/mall/template/adv_bottom.jpg"/></a>       
						</div>
					</div>
				</div>
				<div class="clear"></div>
			</div>
			<div class="clear"></div>
		</div>
		<div class="content content-wbot">
			<div id="left">
				<div class="module_sidebar">
					<div id="module_menu">
						<div id="molude_menu_body">
							<ul id="menulist">
								<!--{foreach from=$scategorys item=scategory}-->
								<li>
									<a href="{url app=search&cate_id=$scategory.id}">{$scategory.value|escape}</a>
									<ul>
										<!--{foreach from=$scategory.children item=child}-->
										<li><a href="{url app=search&cate_id=$child.id}">{$child.value|escape}</a></li>
										<!--{/foreach}-->
									</ul>
								</li>
								<!--{/foreach}-->
							</ul>
						</div>
						<div id="molude_menu_bottom"></div>
					</div>
				</div>
			</div>
			<div id="right">
				<div class="module_scategory padding5">
					<?php
							$sql="SELECT * FROM `ecm_scategory` WHERE `parent_id` =0 ORDER BY `sort_order`";
							$result=mysql_query($sql);
							if(mysql_num_rows($result)>0)
							{
								while($row=mysql_fetch_array($result))
								{
									
					               echo "<div class=\"".cs_dir_category."\">";
									echo "<h6>";
										echo "<a href=\""."index.php?app=search&act=store&cate_id=".$row['cate_id']."\">".$row['cate_name']."</a>";	
									echo "</h6>";
									  echo "<a href=\""."index.php?app=search&cate_id=".$row['cate_id']."\"></a>";
					          	  echo "<img src=\"".$row['img_category']."\" />";	
					          	  //echo $row;
					          	  $sqlsub="SELECT * FROM `ecm_scategory` WHERE `parent_id` =".$row['cate_id']." ORDER BY `sort_order`";
										$resultsub=mysql_query($sqlsub);
										if(mysql_num_rows($resultsub)>0)
										{
											$i=1;
							            	$j=1;
								          	echo "<ul class=\"".cs_dir_sub."\">";
								            while($rowsub=mysql_fetch_array($resultsub))
											{
											  if($i<=3)
								               {
								          	     echo "<li><a class=\"".sub_scate."\" href=\""."index.php?app=search&cate_id=".$rowsub['cate_id']."\">".$rowsub['cate_name']."</a></li>";
								                
								               }
								               $i++;
								               $j++;
								               
								             }
											 if($j>=4)
								             {
								              	$Xemthem='Xem thêm';
								              	echo "<li><a class=\"".sub_scate_more."\" href=\""."index.php?app=search&act=store&cate_id=".$row['cate_id']."\">".$Xemthem."</a></li>";
								              }
								            echo "</ul>"; 
										}
									echo "</div>";
								}
							}	
						?>
						
						
					</div>
					
				</div>
			</div>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
		{include file=footer.html}
	</div>